package com.truth.lock.configure.zookeeper;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author truth
 */
@Component
public class ZookeeperProperties {

    /**
     * Zookeeper服务器地址，IP+端口
     */
    private String zkServers;

    /**
     * Session超时时间
     */
    private int sessionTimeout = 30000;

    /**
     * 连接超时时间
     */
    private int connectionTimeout = 5000;

    private int baseSleepTimeMs = 1000;

    /**
     * 最大重试次数
     */
    private int maxRetries = 3;

    public String getZkServers() {
        return zkServers;
    }

    public void setZkServers(String zkServers) {
        this.zkServers = zkServers;
    }

    public int getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSessionTimeout(int sessionTimeout) {
        this.sessionTimeout = sessionTimeout;
    }

    public int getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public int getBaseSleepTimeMs() {
        return baseSleepTimeMs;
    }

    public void setBaseSleepTimeMs(int baseSleepTimeMs) {
        this.baseSleepTimeMs = baseSleepTimeMs;
    }

    public int getMaxRetries() {
        return maxRetries;
    }

    public void setMaxRetries(int maxRetries) {
        this.maxRetries = maxRetries;
    }
}
